package com.test.controller;

import com.test.framework.context.ApplicationContext;
import com.test.framework.context.support.ClassPathXmlApplicationContext;
import com.test.service.UserService;

/**
 * @ClassName: UserController
 * @description:
 * @author: Mr du
 * @create: 2024-04-01 22:42
 */
public class UserController {

    public static void main(String[] args) throws Exception {
        //创建spring容器对象
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        //从IOC容器中获取UserService对象
        UserService userService = applicationContext.getBean("userService", UserService.class);
        //调用UserService对象的add方法
        userService.add();
    }
}
